<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="crm.util.ParamUtil"%>
<%@page import="java.util.*"%>
<%@page import="crm.model.Customer"%>
<%@page import="crm.control.CustomerControl"%>
<%@page import="crm.util.GetBaseParam"%>
<%@page import="crm.control.SaleareaControl"%>
<%@page import="crm.model.Employees"%>
<%@page import="crm.control.EmployeesControl"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../resources/css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../resources/css/copy.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src='../../../resources/js/jquery-1.6.2.min.js'>
</script>
<script type="text/javascript">
$(function(){
		/*$(".trs").click(function{
		var value = $(this).children(".td").html();
		alert(value);*/
		//alert('');
		$(".trs").click(function(){
			var value = $(this).children(".td").html();
			var valueName = $(this).children(".td2").html();
			//alert(value2);
			window.opener.document.getElementById('findemployee').value=valueName;
			window.opener.document.getElementById('employee').value=value;
			  var browserName=navigator.appName;  
			                 if (browserName=="Netscape"){  
			                       window.open('', '_parent', '');  
			                       window.close();  
			                 }  
			                 if (browserName=="Microsoft Internet Explorer") {   
			                       window.parent.opener = "whocares";   
			                       window.parent.close();   
			                 }  
			               //如果你使用的是firefox浏览器必须要做以下设置 
			               //1、在地址栏输入about:config然后回车，警告确认 
			               //2、在过滤器中输入”dom.allow_scripts_to_close_windows“，双击即可将此//值设为true 
			})
})
</script>
 </head>
 <body>
 <%
        int employeeP = ParamUtil.getInt(request,"p",1);
 
 %>
  <br/>
  <form>
  <table>
  <tr><td>名字</td>
        <td>所属区域</td>
        <td>职位</td>
        <td>联系电话</td>
        <td>邮件</td>
  </tr>
  <%
    int pages = ParamUtil.getInt(request, "pages", 1);
	int rowsPerPage = ParamUtil.getInt(request, "pageSize", 10);
    Collection  es = EmployeesControl.searchEmployees("","","","","","","","","","",rowsPerPage,pages);
    Iterator it = es.iterator();
    System.out.print(es.size()+"SSSS");
    while(it.hasNext()){
    	Employees e  = (Employees)it.next();
  
  %>
  <tr class="trs">
  <td class="td" style="display:none"><%=e.getId() %></td>
  <td class="td2"><%=e.getName() %></td>
  <td><%=SaleareaControl.getAreaName(e.getArea_id()) %></td>
  <td><%=GetBaseParam.getPositionById(e.getPosition()) %></td>
  <td><%=e.getCellphone() %></td>
  <td><%=e.getEmail() %></td>
  </tr>
  <%} %>
  
  </table>
  <br/>
  <%
  out.println(EmployeesControl.pageInstance.getToolsMenu(pages));
  %>
  </form>
</html>